<?php
/**
 * In this file the exception class '\BF\Exception' is defined.
 *
 * @author     Ulf Kadner <ulfikado@gmail.com>
 * @category   Beluga PHP5.3+ Framework
 * @copyright  (c) 2015, Ulfikado
 * @package    BF\Core
 * @since      2015-01-16 23:59
 * @subpackage Exceptions
 * @version    0.1
 */

namespace BF
{

   /**
    * This Exception defines the base functionality for all other Framework exceptions.
    *
    * @since  v1.0.0
    */
   class Exception extends \BF\ExceptionBase
   {

      # <editor-fold defaultstate="collapsed" desc=" - - >   P U B L I C   C O N S T R U C T O R   - - - - - - - - - - - - - - - - - -">

      /**
       * Init's a new instance.
       *
       * @param string     $message  The error message
       * @param int        $code     The optional Error code (defaults to \E_ERROR)
       * @param \Exception $previous A optional previous exception
       */
      public function __construct( $message, $code = \E_ERROR, \Exception $previous = null )
      {

         parent::__construct( $message, $code, $previous );

      }

      # </editor-fold>

      # <editor-fold defaultstate="collapsed" desc=" - - -   P R O T E C T E D   M E T H O D S   - - - - - - - - - - - - - - - - - - -">

      /**
       * Appends a message, if its not empty, separated by ' '.
       *
       * @param  string $message
       * @return string
       */
      protected function appendMessage( $message )
      {
         return empty( $message ) ? '' : ( ' ' . $message );
      }

      # </editor-fold>

   }

}

